﻿using ChestPainCenterSystem.Core;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;

namespace ChestPainCenterSystem.Code.Bll
{
    public class TableColumnManager
    {
        /// <summary>
        /// 获取子集字段列表
        /// </summary>
        /// <returns></returns>
        public static OperateResult GetData()
        {
            OperateResult resultInfo = new OperateResult();
            try
            {
                string NameSelect = @"use ThreeCenterManage; 
                            SELECT * FROM [TableColumn] where  Status <> 2 ";
                DataSet NameList = SQLDLL.SqlHelper.ExecuteDataset(NameSelect, System.Data.CommandType.Text);


                if (NameList != null && NameList.Tables != null && NameList.Tables.Count > 0)
                {
                    DataTable dt = NameList.Tables[0];
                    resultInfo.Body = dt;
                    resultInfo.Result = 1;
                }
                else
                {
                    resultInfo.Result = 0;
                    resultInfo.Body = "查询失败";
                }
            }
            catch (Exception ex)
            {
                resultInfo.Result = -1;
                resultInfo.Body = ex.Message;
            }
            return resultInfo;
        }
    }
}